<?php

    // +----------------------------------------------------------------------
    // | 任务
    // +----------------------------------------------------------------------
    // | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
    // +----------------------------------------------------------------------
    // | Author: 微尘 <yicmf@qq.com>
    // +----------------------------------------------------------------------

    namespace app\common\model;

    class Job extends Common
    {


        /**
         * 队列任务
         * @return \think\model\relation\HasMany
         * @author  : 微尘 <yicmf@qq.com>
         */
        public function tasks()
        {
            return $this->hasMany(JobTask::class);
        }
		/**
		 * 写入修改
		 * @param $data
		 */
		public static function onBeforeInsert($data)
		{
			$data['status'] = 1;
		}

        protected $type = [
            'data' => 'array',
        ];
    }
